using System.ComponentModel.DataAnnotations;
using FytSoa.Common.Enum;
using SqlSugar;

namespace FytSoa.Domain.Erp;

/// <summary>
/// erp-调拨
/// </summary>
[SugarTable("erp_transfer")]
public class ErpTransfer:Entity
{
    /// <summary>
    /// 调拨编号
    /// </summary>
    [Required]
    [StringLength(50)]
    public string Number { get; set; }

    /// <summary>
    /// 调拨名称
    /// </summary>
    [Required]
    [StringLength(50)]
    public string Name { get; set; }

    /// <summary>
    /// 调拨时间
    /// </summary>
    [Required]
    public DateTime TransferTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 调出仓库编号
    /// </summary>
    [Required]
    public long OutStockId { get; set; }
    
    /// <summary>
    /// 出库仓库信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(OutStockId))]
    public ErpWarehouse OutWarehouse { get; set; }

    /// <summary>
    /// 调入仓库编号
    /// </summary>
    [Required]
    public long InStockId { get; set; }
    
    /// <summary>
    /// 入库仓库信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(InStockId))]
    public ErpWarehouse InWarehouse { get; set; }
    
    /// <summary>
    /// 审核状态
    /// </summary>
    public ErpAuditEnum Status { get; set; } = 0;

    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}